FROM cr.registry.ah-1.res.sgmc.sgcc.com.cn/ixt-common/edas:latest

MAINTAINER "fengya<29895236@qq.com>" 
#创建容器内运行目录
RUN mkdir -p /home/admin

#设置环境变量
ENV ADMIN_HOME /home/admin
ENV JAVA_HOME /usr/java/latest
ENV PATH ${JAVA_HOME}/bin:$PATH
# 增加容器内中⽂支持
ENV LANG="en_US.UTF-8"
# 增强 Webshell 使⽤体验
ENV TERM=xterm
#设置JVM性能优化参数
ENV JVM_OPTS="-Xms256m -Xmx1024m -XX:+UseG1GC -XX:MaxGCPauseMillis=200"

#添加jar包到镜像文件中
${add-app-file}
#ADD comm-test2-server.jar ${ADMIN_HOME}/comm-test2-server.jar

#设置容器时区
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone

# 创建 JAVA_HOME 软链接
RUN if [ ! -L "${JAVA_HOME}" ]; then mkdir -p `dirname ${JAVA_HOME}` && ln -s `readlink -f /usr/lib/jvm/java` ${JAVA_HOME}; fi

${echo-run-app-commond}
#RUN echo '${JAVA_HOME}/bin/java ${JVM_OPTS} ${CATALINA_OPTS} -jar ${CATALINA_OPTS} ${ADMIN_HOME}/comm-test2-server.jar&${JAVA_HOME}/bin/java ${JAVA_OPTS} ${CATALINA_OPTS} -jar ${CATALINA_OPTS} ${ADMIN_HOME}/comm-test1-server.jar'> ${ADMIN_HOME}/start.sh && chmod +x ${ADMIN_HOME}/start.sh

CMD ["/bin/bash", "/home/admin/start.sh"]